package com.nervenets.template.hibernate.domain.common;

import com.nervenets.general.annotation.JsonGhostly;
import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.template.enumeration.UnionType;
import com.nervenets.template.service.ManagerJsonGhostlyHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Type;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@ApiModel("投诉建议表")
@Entity
@Table
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class Feedback extends DomainObject {
    @ApiModelProperty(value = "关联类型")
    private UnionType unionType;
    @ApiModelProperty(value = "关联ID")
    private long unionId;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "图片")
    @Type(type = "json")
    private List<String> images;
    @Transient
    @ApiModelProperty(value = "关联对象")
    private Object union;
    @ApiModelProperty(value = "处理时间")
    private long handleTime;
    @ApiModelProperty(value = "处理人")
    @JsonGhostly(type = ManagerJsonGhostlyHandler.class)
    private long handleUserId;
    @ApiModelProperty(value = "处理备注")
    private String handleRemark;

    /*以下是附加需要的内容*/
    @Transient
    @ApiModelProperty(value = "创建人名称")
    private String createUserName;
    @ApiModelProperty(value = "创建人头像")
    private String createUserAvatar;
    @Transient
    @ApiModelProperty(value = "处理人名称")
    private String handleUserName;
}
